package com.atguigu.crowd.entity;

import java.util.ArrayList;
import java.util.List;

public class Menu {
	/**
	 * 主键
	 */
    private Integer id;
    
    /**
     *父节点的id 
     */
    private Integer pid;

    /**
     * 节点名称
     */
    private String name;

    /**
     * 节点图标的样式
     */
    private String icon;
    
    /**
     * 节点附带的URL地址，也是将来点击菜单时要跳转的地址
     */
    private String url;
    
    /**
     * 存储子节点的集合，初始化是为了避免空指针异常
     */
    private List<Menu> children=new ArrayList<>();//避免空指针异常
    
    /**
     * 控制节点是否默认打开行为，设置true就表示默认打开
     */
    private Boolean open=true;//默认就是打开
    

    /**
     * 无参构造
     */
    public Menu() {
		super();
	}
    /**
     * 有参构造
     * @param id 主键
     * @param pid 父节点的id 
     * @param name 节点名称
     * @param icon 节点图标的样式
     * @param url 节点附带的URL地址，也是将来点击菜单时要跳转的地址
     * @param children 存储子节点的集合
     * @param open 节点是否默认打开的行为
     */
	public Menu(Integer id, Integer pid, String name, String icon, String url, List<Menu> children, Boolean open) {
		super();
		this.id = id;
		this.pid = pid;
		this.name = name;
		this.icon = icon;
		this.url = url;
		this.children = children;
		this.open = open;
	}


	public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
    }
    
    
	public List<Menu> getChildren() {
		return children;
	}
	public void setChildren(List<Menu> children) {
		this.children = children;
	}
	public Boolean getOpen() {
		return open;
	}
	public void setOpen(Boolean open) {
		this.open = open;
	}
	
	@Override
	public String toString() {
		return "Menu [id=" + id + ", pid=" + pid + ", name=" + name + ", icon=" + icon + ", url=" + url + ", children="
				+ children + ", open=" + open + "]";
	}
    
    
}